package com.jnc.plug.mybatis.mp.generator.config;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.TemplateConfig;

/**
 * @Description
 * @Author fanlei
 * @Version 1.0
 * @Date 2019/9/28
 */
public class CustomTemplate {
    private AutoGenerator mpg;

    public CustomTemplate(AutoGenerator mpg) {
        this.mpg = mpg;
    }

    public void invoke() {
        mpg.setTemplate(
                new TemplateConfig()
                        .setController(Context.templateController)
                        .setEntity(Context.templateEntity)
                        .setMapper(Context.templateMapper)
                        .setXml(Context.templateXml)
                        .setService(Context.templateService)
                        .setServiceImpl(Context.templateServiceImpl)
        );
    }
}
